home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Programmer's Power Pack
/
Delphi Volume 1.iso
/
e_to_l
/
isamexpt
/
wntisam2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-09-15
|
20KB
|
600 lines
unit Wntisam2;
interface
uses WinTypes, Classes, Graphics, Forms;
{$I DEFINE.PAS}
function Erzeuge_EditorForm(const FormIdent: string;
RecList: TStringList;
Label_Neben_Input: Boolean;
InputLen_Fest: Boolean;
LFont, EFont: TFont;
Sprache: Integer): TForm;
implementation
Uses WinProcs, SysUtils, Controls, ExtCtrls, Proxies,
Db, WntIsam4, StdCtrls, Buttons,
{$IFDEF NEWINPUTS}
NumCtrl, DateEdit,
{$ENDIF}
IsamTabl;
function Erzeuge_EditorForm(const FormIdent: string;
RecList: TStringList;
Label_Neben_Input: Boolean;
InputLen_Fest: Boolean;
LFont, EFont: TFont;
Sprache: Integer): TForm;
var
BtnPos : TPoint;
Method,KeyMethod: TMethod;
MP,UP,UP1,UP2,UP3: TPanel;
SP : TSpeedButton;
Tbl : TIsamTable;
dx,W,i,Ty,G : Integer;
xDecimals : Integer;
SLab : TLabel;
{$IFDEF NEWINPUTS}
SInp : TStrEdit;
DInp : TDateEdit;
NInp : TNumEdit;
{$ELSE}
SInp : TEdit;
PInp : TEdit;
NInp : TEdit;
{$ENDIF}
MInp : TMemo;
RInp : TRadioGroup;
Tm : TTimer;
FieldName,FeldName,SStr,AStr,MStr: String;
Len,Arr1,Arr2,A : Integer;
FieldDataType : TFieldType;
begin
Result := TProxyForm.CreateAs('T' + FormIdent);
with Result do begin
BorderStyle := bsDialog;
Left:= 100;
Top:= 101;
Width := 400;
Height := 282;
Position := poScreenCenter;
Name := FormIdent;
Caption := FormIdent;
KeyPreview:= True;
AutoScroll := True;
Method.Code := TProxyForm(Result).CreateMethod('FormCreate');
Method.Data := Result;
OnCreate := TNotifyEvent(Method);
Method.Code := TProxyForm(Result).CreateMethod('FormDestroy');
Method.Data := Result;
OnDestroy := TNotifyEvent(Method);
KeyMethod.Code:= TProxyForm(Result).CreateMethod('FormKeyPress');
KeyMethod.Data:= Result;
OnKeyPress:= TKeyPressEvent(KeyMethod);
with Font do begin
Color := clBlack;
Height:= -11;
Name := 'Arial';
Size := 8;
Style:= [fsBold];
end;
MP:= TPanel.Create(Result);
with MP do begin
Parent := Result;
Name := 'Panel1';
Align := alTop;
ShowHint:= True;
Caption:= '';
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 10;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'Back'
else Hint := 'Zurⁿck';
Name := 'RueckBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_RUECK');
Method.Code := TProxyForm(Result).CreateMethod('RueckBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 35;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'forward'
else Hint := 'VorwΣrts';
Name := 'VorBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_VOR');
Method.Code := TProxyForm(Result).CreateMethod('VorBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 60;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'Search'
else Hint := 'Suchen';
Name := 'SuchBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_SUCH');
Method.Code := TProxyForm(Result).CreateMethod('SuchBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 85;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'Sort order'
else Hint := 'Sortierordnung';
Name := 'KeyBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_KEY');
Method.Code := TProxyForm(Result).CreateMethod('KeyBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 110;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'clear'
else Hint := 'Leeren';
Name := 'NeuBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_NEU');
Method.Code := TProxyForm(Result).CreateMethod('NeuBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 135;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'save new record'
else Hint := 'Anlegen';
Name := 'AnlegBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_ANLEGEN');
Method.Code := TProxyForm(Result).CreateMethod('AnlegBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 160;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'save changed record'
else Hint := '─ndern';
Name := 'AendernBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_AENDERN');
Method.Code := TProxyForm(Result).CreateMethod('AendernBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 185;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'delete record'
else Hint := 'L÷schen';
Name := 'LoeschBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_LOESCHEN');
Method.Code := TProxyForm(Result).CreateMethod('LoeschBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 215;
Top := 8;
Width := 25;
Height := 25;
Hint := 'Ok';
Name := 'OkBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_OK');
Method.Code := TProxyForm(Result).CreateMethod('OkBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
Sp:= TSpeedButton.Create(Result);
with SP do begin
Parent:= MP;
Left:= 358;
Top := 8;
Width := 25;
Height := 25;
if Sprache = 1 then Hint:= 'End'
else Hint := 'Ende';
Name := 'AbbruchBttn';
Glyph.Handle:= LoadBitmap(HInstance,'IS_ENDE');
Method.Code := TProxyForm(Result).CreateMethod('AbbruchBttnClick');
Method.Data := Result;
Sp.OnClick := TNotifyEvent(Method);
end;
UP:= TPanel.Create(Result);
with UP do begin
Parent := Result;
Name := 'Panel2';
Align := alBottom;
BevelInner:= bvLowered;
Height:= 27;
ShowHint:= False;
Caption:= '';
end;
UP1:= TPanel.Create(Result);
With UP1 do begin
Parent:= UP;
Left := 308;
Top := 2;
Width := 108;
Height:= 23;
Align := alRight;
BevelOuter := bvLowered;
Font.Color := clBlack;
Font.Height := -11;
Font.Name := 'Arial';
Font.Style := [];
Name:= 'ZeitPanel';
Caption:= '';
end;
UP3:= TPanel.Create(Result);
with UP3 do begin
Parent:= UP;
Left := 2;
Top := 2;
Width := 186;
Height:= 23;
Align := alClient;
ShowHint:= True;
BevelInner := bvLowered;
BevelOuter := bvNone;
Font.Color := clBl